<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>分页</title>

    <script>
        var serverUrl = 'http://apiv2.5151study.com';
        $.setData({serverUrl:serverUrl})

        var showPage = function (data) {
            console.log(data);
            $.setData({list:data.data});
            //如果最后一页需要返回false
            if(data.data.length>0){
                return true;
            } else {
                return false;
            }

        }

        var swichUrl = function (url) {
            $.setData({list:null});
            if(url == '/article/list'){
                $.scrollReset({url:serverUrl+url, data:{title:'李'}})
            } else {
                $.scrollReset({url:serverUrl+url, data:{gradeId:1}})
            }

        }
    </script>
</head>
<body>

    <div>
        <span onclick="$.goSwitch('?_=list&urlPath=/recite/user/page&gradeId=1')">列表1</span>
        <span onclick="$.goSwitch('?_=list&urlPath=/article/list&title=李')">列表2</span>
    </div>


    <div style="margin-bottom: 30px;" data-each="{item:list}">
        <div style="font-size: 33px;" data-text="{item.title}"></div>
        <div data-text="{item.author}"></div>
        <div data-text="{item.prevText}"></div>
    </div>


    <div data-scroll="{serverUrl}{search.urlPath}" data-scroll-data="page=1&gradeId={search.gradeId}&title={search.title}" data-scroll-success="$.showPage()"></div>

</body>
</html>